package com.example.fragmentest.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.fragmentest.R

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
//        button.setOnClickListener{
//            replaceFragment(AnotherRightFragment())
//        }
//        replaceFragment(RightFragment())
//        val fragment = supportFragmentManager.findFragmentById(R.id.leftFlag) as LeftFragment
//        val leftFragment  = leftFlag as LeftFragment
    }


//    private fun replaceFragment(fragment:Fragment){
//        val fragmentManager = supportFragmentManager
//        val transaction = fragmentManager.beginTransaction()
//        transaction.replace(R.id.rightLayout,fragment)
//        transaction.addToBackStack(null)
//        transaction.commit()
//    }
}